/*
2019.9.6
*/
#include<iostream>
#include<vector>
#include<string>
using std::cout;
using std::cin;
using std::cout;
using std::endl;
using std::string;
int main()
{
	int lengthOfLongestSubstring(string s) ;
	string s="av";
	cout<<lengthOfLongestSubstring(s)<<endl;
	return 0;
}
int lengthOfLongestSubstring(string s) 
{
	if(s.empty())
	{
		return 0;
	}
	int i=0,max=1;
    for(int j=0;j<s.size();j++)
	{
		for(int k=i;k<j;k++)
		{
			if(s[k]==s[j])
			{
				i=k+1;
				break;
			}
		}
		
		if(j-i+1>max)
		{
			max=j-i+1;
		}
		
	} 
	return max;   
}

